<template>
    <view class="white-block">
        <uni-datetime-picker class="date-picker" v-model="date" type="date" return-type="timestamp" @change="handleChange" />
    </view>
</template>

<script setup>
	import { ref } from 'vue';
	import { onShow } from "@dcloudio/uni-app";

    const emit = defineEmits(['change'])
    
    const date = ref(0)

	const handleChange = (e) => {
        emit('change', e)
	}

	onShow(()=>{
        date.value = new Date().getTime()
        emit('change', date.value)
	})
</script>

<style lang="less" scoped>
.white-block {
    height: 104rpx;
    padding: 20rpx;
    .date-picker {
        width: 100%;
        height: 100%;
    }
}
</style>

